package com.bezdelnick.forum.web.page;

import com.bezdelnick.forum.web.page.template.BaseTemplate;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.request.mapper.parameter.PageParameters;

/**
 * Created by IntelliJ IDEA.
 * User: Bezdelnick
 * Date: 21.08.12
 * Time: 13:56
 * To change this template use File | Settings | File Templates.
 */
public class ErrorPage extends BaseTemplate {
    private String errorMessage = "Unknown error";

    public ErrorPage() {
        this(new PageParameters());
    }

    public ErrorPage(PageParameters pageParameters) {
        this.getPageParameters().mergeWith(pageParameters);

        if (!pageParameters.get("error").isNull())
            errorMessage = pageParameters.get("error").toString();

        Label lblMessage = new Label("message", errorMessage);
        add(lblMessage);
    }
}
